home *** CD-ROM | disk | FTP | other *** search
/ Master Visual Basic 3 / Master Visual Basic 3 (SAMS Publishing) (1994).ISO / mvprog / original / ch07 / loop3.bas next >
Encoding:
BASIC Source File  |  1994-03-03  |  641 b   |  36 lines

  1. Option Explicit
  2.  
  3. Sub Main ()
  4.  
  5.     ' Declare variables
  6.     Dim XPos, YPos
  7.     
  8.  
  9.     'Show the from
  10.     frmLoop3.Show
  11.  
  12.    
  13.    Do While DoEvents()
  14.  
  15.       ' Set current position to center of the form
  16.       frmLoop3.CurrentX = frmLoop3.ScaleWidth / 2
  17.       frmLoop3.CurrentY = frmLoop3.ScaleHeight / 2
  18.  
  19.       
  20.       ' Set size of dot
  21.       frmLoop3.DrawWidth = frmLoop3.hsbSize.Value
  22.     
  23.       'Set the point coordinates
  24.       XPos = Rnd * frmLoop3.ScaleWidth
  25.       YPos = Rnd * frmLoop3.ScaleHeight
  26.     
  27.       ' Draw the point
  28.       frmLoop3.PSet (XPos, YPos), QBColor(Rnd * 15)
  29.     
  30.     
  31.     Loop
  32.  
  33.  
  34. End Sub
  35.  
  36.